package com.zbl.zblproject.erp.service;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zbl.zblproject.core.entity.FactoryOrder;
import com.zbl.zblproject.core.entity.Order;
import com.zbl.zblproject.core.entity.Supplier;
import com.zbl.zblproject.erp.entity.ErpGoods;


import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/10/9
 * ErpGood类型的服务接口
 */
public interface ErpGoodService {

    /**
     * 批量对ErpGood进行删除
     * @param id
     * @return
     */
    boolean deleteErpGood(List<Integer> id);

    boolean deleteErpGoodBySn(String sn);

    /**
     * 查询类表
     * @param search
     * @param current 第几页
     * @param size   几项
     * @param cate 分类ID
     * @param sup 供应商ID
     * @return
     */
    IPage<ErpGoods> erpGoodsList(String search, int current, int size, int cate, int sup, int status);


    /**
     * 查询类表
     * @param search
     * @param current 第几页
     * @param size   几项
     * @param cate 分类ID
     * @param sup 供应商ID
     * @return
     */
    IPage<ErpGoods> erpGoodsList(String search, int current, int size, int cate, int sup, int code, int sale, int status, int brand, String codesn);

    /**
     * 查询类表
     * @param search
     * @param current 第几页
     * @param size   几项
     * @return
     */
    IPage<ErpGoods> erpGoodsListOfWarehouse(String search, int current, int size);

    /**
     * 查询仓库中对应商品编号的商品
     * @param goodsSn  商品编号
     * @return
     */
    ErpGoods erpGoodsOfWarehouseBySn(String goodsSn);

    ErpGoods selectByIdPure(int id);

    ErpGoods selectById(int id);

    ErpGoods selectBySn(String orderSn);

    /**
     * 对erpGood进行更新
     * @param goods
     * @return
     */
    boolean updateErpGood(ErpGoods goods);


    boolean updateByGoodsSn(ErpGoods goods);

    /**
     * 添加一个GoodErp
     * @param erpGood
     * @return
     */
    boolean addErpGood(ErpGoods erpGood);

    /**
     * 查询门店订单商品列表
     * @param start 开始时间
     * @param end   结束时间
     * @param search  查询
     * @return
     */
    List<FactoryOrder> listOfStore(String start, String end, String search);

    List<FactoryOrder> listOfStoreAndConfirm(String start, String end, String search);

    /**
     * 获取打印列表
     * @param ids
     * @return
     */
    JSONArray printList(Integer[] ids);

    /**
     * 查询所有缺货商品
     * @return
     */
    List<ErpGoods> stockOutGoods();

    boolean replenishGoods(int id, int num);

    IPage<ErpGoods> boughtPage(int catId, int brandId, int supplierId,  int current, int size, int type, int mode,
                               String name);


    List<ErpGoods> getErpGoodsByPreAndFlush(Integer preStatus);

    JSONArray selectPrice(String priceSn);
}
